# encoding: utf-8

class TeamConfig(object):
    def __init__(self):
        self.accesscory_ap = 780 * 3
        self.accesscory_te = 1170 * 3
        # 默认18层中高配
        self.set_level("mid-high")
        self.vog_multiplier = 1.2

        self.teammate_card_te = 13000

    def set_level(self, level="mid-high", accesscory_level="normal", difficulty="上级+", is_same_color=True):

        self.level = level
        self.difficulty = difficulty
        self.accesscory_st = 780 * 3
        if difficulty == "上级+":
            self.total_notes = 300
            self.sp_average_note = 25
            self.sp_from_acs = 5
            self.num_acs = 7
            self.sp_gauge = 7200
            if accesscory_level == "low":
                # 2手镯1胸针
                self.accesscory_active_ap = 1.05
                self.accesscory_ap = 780 * 2 + 1040
                self.accesscory_te = 1170 * 2 + 780
                self.accesscory_critical = 1.4
                self.score_limit = 250000
            elif accesscory_level == "normal":
                # 2手镯1项圈
                self.accesscory_active_ap = 1.
                self.accesscory_ap = 780 * 3
                self.accesscory_te = 1170 * 3
                self.accesscory_critical = 1.4
                self.score_limit = 275000
            elif accesscory_level == "high":
                # 1手镯2项圈
                self.accesscory_active_ap = 1.
                self.accesscory_ap = 780 * 3
                self.accesscory_te = 1170 * 3
                self.accesscory_critical = 1.2
                self.score_limit = 300000
        elif difficulty == "上级":
            self.total_notes = 180
            self.sp_average_note = 15
            self.sp_from_acs = 4
            self.num_acs = 6
            self.sp_gauge = 6000
            self.accesscory_ap = 780 * 3
            self.accesscory_te = 1170 * 3
            # 1手镯2项圈
            #self.accesscory_critical = 1.2
            #self.score_limit = 120000
            # 3项圈
            self.accesscory_active_ap = 1.
            self.accesscory_critical = 1.
            self.score_limit = 130000
        elif difficulty == "无上限":
            self.score_limit = 10000000
            self.sp_gauge = 8400
            self.sp_from_acs = 5
            self.num_acs = 7
            # 2手镯1胸针
            self.accesscory_active_ap = 1.05
            self.accesscory_ap = 780 * 2 + 1040
            self.accesscory_te = 1170 * 2 + 780
            self.accesscory_critical = 1.4


        # 8层低配
        if level == "low":
            self.total_raw_ap = 40000
            self.total_attack = 100000
            self.skill_magical = 20000
            self.skill_physical = 2000
            self.kizuna_multiplier = 1.12
            self.kizuna_critical_rate = 0.025
            self.sk_type_debuff = 0.045
            self.gd_type_debuff = 0.045
            self.sp_type_debuff = 0.045
            self.raw_ap_multiplier = 1.8
            self.raw_te_multiplier = 1.05
            self.active_ap_multiplier = 1.15
            self.base_critical_damage = 1.8
            self.critical_multiplier = self.accesscory_critical * self.base_critical_damage
            self.same_attribute_multiplier = 1.275
            self.sp_score = 350000
            self.score_baseline = 190000

        # 13层中低配
        if level == "mid-low":
            self.total_raw_ap = 45000
            self.total_attack = 110000
            self.skill_magical = 25000
            self.skill_physical = 2500
            self.kizuna_multiplier = 1.15
            self.kizuna_critical_rate = 0.03
            self.sk_type_debuff = 0.045
            self.gd_type_debuff = 0.045
            self.sp_type_debuff = 0.045
            self.raw_ap_multiplier = 1.9
            self.raw_te_multiplier = 1.1
            self.active_ap_multiplier = 1.2
            self.base_critical_damage = 1.9
            self.critical_multiplier = self.accesscory_critical * self.base_critical_damage
            self.same_attribute_multiplier = 1.3
            self.sp_score = 400000
            self.score_baseline = 225000

        # 18层中高配
        if level == "mid-high":
            self.total_raw_ap = 50000
            self.total_attack = 120000
            self.skill_magical = 30000
            self.skill_physical = 3000
            self.kizuna_multiplier = 1.18
            self.kizuna_critical_rate = 0.05
            self.sk_type_debuff = 0.04
            self.gd_type_debuff = 0.04
            self.sp_type_debuff = 0.04
            self.raw_ap_multiplier = 2.
            self.raw_te_multiplier = 1.1
            self.active_ap_multiplier = 1.2
            self.base_critical_damage = 2.15
            self.critical_multiplier = self.accesscory_critical * self.base_critical_damage
            self.same_attribute_multiplier = 1.35
            self.sp_score = 450000
            self.score_baseline = 265000

        # 23层高配
        if level == "high":
            self.total_raw_ap = 50000
            self.total_attack = 125000
            self.skill_magical = 30000
            self.skill_physical = 3000
            self.kizuna_multiplier = 1.2
            self.kizuna_critical_rate = 0.055
            self.sk_type_debuff = 0.04
            self.gd_type_debuff = 0.04
            self.sp_type_debuff = 0.04
            self.raw_ap_multiplier = 2.1
            self.raw_te_multiplier = 1.1
            self.active_ap_multiplier = 1.2
            self.base_critical_damage = 2.25
            self.critical_multiplier = self.accesscory_critical * self.base_critical_damage
            self.same_attribute_multiplier = 1.375
            self.sp_score = 500000
            self.score_baseline = 285000
            
        # 28层超高配
        if level == "very-high":
            self.total_raw_ap = 50000
            self.total_attack = 125000
            self.skill_magical = 30000
            self.skill_physical = 3000
            self.kizuna_multiplier = 1.22
            self.kizuna_critical_rate = 0.065
            self.sk_type_debuff = 0.035
            self.gd_type_debuff = 0.04
            self.sp_type_debuff = 0.04
            self.raw_ap_multiplier = 2.1
            self.raw_te_multiplier = 1.1
            self.active_ap_multiplier = 1.2
            self.base_critical_damage = 2.5
            self.critical_multiplier = self.accesscory_critical * self.base_critical_damage
            self.same_attribute_multiplier = 1.425
            self.sp_score = 500000
            self.score_baseline = 300000

        self.skill_magical_sp = self.skill_magical * 2 / 3
        self.skill_magical_vog = self.skill_magical * 1 / 3
        self.vog_limit = 100000
        self.skill_trigger_bonus = 1.1
        if difficulty == "上级":
            self.sp_score = 250000
            self.vog_limit = 50000
            self.skill_trigger_bonus = 1.2
            #self.skill_trigger_bonus = 1.1
        if accesscory_level == "low" and difficulty == "上级+":
            self.active_ap_multiplier += 0.05
        if not is_same_color:
            self.same_attribute_multiplier = 1.
        self.sp_cycle = 1.
        self.sp_type_time_bonus = 1.1
        if self.difficulty == "上级" and "high" in level:
            # sp循环系数（拉拉南）和后排调整
            self.sp_cycle = 1.1
            self.raw_ap_multiplier -= 0.1

        self.appeal_multipliers = {
                1.2: 0.1,
                1.3: 0.05,
                1.4: 0.05,
                1.5: 0.2,
                1.6: 0.2,
                1.7: 0.2,
                1.8: 0.1,
                1.9: 0.1
            }
        if difficulty == "上级":
            self.appeal_multipliers = {
                1.2: 0.1,
                1.3: 0.1,
                1.4: 0.2,
                1.5: 0.2,
                1.6: 0.2,
                1.7: 0.1,
                1.8: 0.1
            }
            

class SongConfig(object):
    def __init__(self):
        self.appeal_multipliers = {
            1.2: 0.1,
            1.3: 0.05,
            1.4: 0.05,
            1.5: 0.2,
            1.6: 0.2,
            1.7: 0.2,
            1.8: 0.1,
            1.9: 0.1
        }
